<?php
	set_time_limit("-1");
	include 'cls_transport.php';
	$request = new transport(-1,-1,-1,true);
	//$url = "http://localhost/index.php";
	$url = "http://www.winapi.com:8080/app_dev.php/agent/list";
	$params = array('vcc_id'=>10,'ag_id'=>14);
	$method = 'post';
	$nonce = generate_word(20);
	//格林威治时间的时间戳
	$Created = date("Y-m-d H:i:s",(time()-date("Z")));
	$secret ="e10adc3949ba59abbe56e057f20f883e"; //密码
	$username = "wintel"; //分配的用户名
	$PasswordDigest = base64_encode(sha1(base64_decode($nonce).$Created.$secret, true));
	$wsse = 'UsernameToken Username="'.$username.'", PasswordDigest="'.$PasswordDigest.'", Nonce="'.$nonce.'", Created="'.$Created.'"';
	$head_par = array("X-WSSE"=>$wsse);
    $response = $request->request($url,$params,$method,$head_par);
   // $response = $request->request($url,$params,$method);
	echo $response['body'];
	function generate_word($length = 4)
    {
        $chars = '23456789ABCDEFGHJKLMNPQRSTUVWXYZ';

        for ($i = 0, $count = strlen($chars); $i < $count; $i++)
        {
            $arr[$i] = $chars[$i];
        }

        mt_srand((double) microtime() * 1000000);
        shuffle($arr);

        return substr(implode('', $arr), 5, $length);
    }
?>